package src
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	import gs.TweenMax;
	
	import nl.demonsters.debugger.MonsterDebugger;

	public class ItemLookBox extends Sprite
	{
		public function ItemLookBox()
		{
			this.mouseChildren = false;
			this.buttonMode = true;
			fondo_mc.alpha = 0;
			this.addEventListener(MouseEvent.MOUSE_OVER, over);
			this.addEventListener(MouseEvent.MOUSE_OUT, out);
			this.addEventListener(MouseEvent.CLICK, clic);
		}
		
		private function over (e:MouseEvent):void
		{
			TweenMax.to(fondo_mc, 0.2, {alpha:1});
		}
		
		private function out (e:MouseEvent):void
		{
			TweenMax.to(fondo_mc, 0.2, {alpha:0});
		}
		
		private function clic (e:MouseEvent):void
		{
			var valor:String = String(texto_txt.text);
			LookBox(parent.parent).actualizaTexto(valor);
			
			dispatchEvent( new ItemLookBoxEvent(ItemLookBoxEvent.ON_LOOK_CLICK) );
		}
	}
}